﻿using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Reactive.Disposables;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace RxWPF.Views
{
    public class MainViewBase : ReactiveUserControl<MainViewer>
    {

    }
    /// <summary>
    /// MainView.xaml 的交互逻辑
    /// </summary>
    public partial class MainView
    {
        public MainView()
        {
            InitializeComponent();

            var vm= this.ViewModel;
            this.WhenActivated(d =>
            {
                this.DataContext = this.ViewModel;
                
                //this.WhenAnyValue(x => x.ViewModel).BindTo(this, x => x.DataContext).DisposeWith(d);

                //this.Bind(ViewModel, vm => vm, view => view.DataContext);
            });
        }
    }
}
